<template>
  <one-data-com :get-data-fun="getDataFunc" @data="souceFunc">
    <json-editer ref="JsonEditer"/>
  </one-data-com>
</template>

<script lang="ts">
  import OneDataCom from '@/components/data/oneData/index.vue'
  import { Vue, Component } from 'vue-property-decorator'
  import JsonEditer from '@/components/global/jsoneditor/index.vue'
  import { JsonEditerType } from '@/components/global/jsoneditor/types'
  import YBPopView from "@/utils/popView";

  @Component({
    components: {
      OneDataCom,
      JsonEditer
    }
  })
  export default class JSONDataModel extends Vue {

    souceFunc(data: string) {
      (this.$refs.JsonEditer as JsonEditerType).setData(data);
    }

    getDataFunc() {
      return (this.$refs.JsonEditer as JsonEditerType).getData()
    }
  }

</script>

<style lang="scss">

</style>
